import type { ButtonProps } from 'element-plus';
import type { ElTooltipProps } from 'element-plus/es/components/tooltip';

export interface PopConfirm {
  title: string;
  confirmButtonText?: string;
  cancelButtonText?: string;
  confirm: () => void;
  cancel?: () => void;
  icon?: string;
  disabled?: boolean;
  // Element Plus 特有的属性
  hideIcon?: boolean;
  hideAfter?: number;
  teleported?: boolean;
  width?: number | string;
}

export interface ActionItem extends Partial<ButtonProps> {
  onClick?: () => void;
  type?: 'danger' | 'info' | 'primary' | 'success' | 'text' | 'warning';
  label?: string;
  color?: string;
  icon?: string;
  popConfirm?: PopConfirm;
  disabled?: boolean;
  divider?: boolean;
  // 权限编码控制是否显示
  auth?: string[];
  // 业务控制是否显示
  ifShow?: ((action: ActionItem) => boolean) | boolean;
  tooltip?: ElTooltipProps | string;
  // Element Plus 特有的按钮属性
  size?: 'default' | 'large' | 'small';
  loading?: boolean;
  circle?: boolean;
  round?: boolean;
  autoFocus?: boolean;
  nativeType?: 'button' | 'reset' | 'submit';
  // 链接相关属性
  link?: boolean;
  text?: boolean;
  bg?: boolean;
}
